﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DatabaseModel.Model
{
    partial class User : BaseModel
    {
        [NotMapped]
        public string UserRole
        {
            get
            {
                string userRole = string.Empty;
                if (Roles != null && Roles.Count > 0)
                {
                    userRole = Roles.Aggregate(userRole, (current, role) => string.Concat(role.RoleName, "; ", current));
                }
                return userRole;
            }
        }
    }
}
